package com.weitu.worklicense.service.impl;

import com.weitu.worklicense.entity.LimitLicense;
import com.weitu.worklicense.entity.LimitLicenseCriteria;
import com.weitu.worklicense.mapper.LimitLicenseMapper;
import com.weitu.worklicense.service.LimitLicenseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class LimitLicenseServiceImpl implements LimitLicenseService {
    private final LimitLicenseMapper limitLicenseMapper;

    private static final Logger logger = LoggerFactory.getLogger(LimitLicenseServiceImpl.class);

    @Autowired
    public LimitLicenseServiceImpl(LimitLicenseMapper limitLicenseMapper) {
        this.limitLicenseMapper = limitLicenseMapper;
    }

    @Override
    public int countByCriteria(LimitLicenseCriteria example) {
        int count = this.limitLicenseMapper.countByCriteria(example);
        logger.debug("count: {}", count);
        return count;
    }

    @Override
    public LimitLicense selectByPrimaryKey(String id) {
        return this.limitLicenseMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<LimitLicense> selectByCriteria(LimitLicenseCriteria example) {
        return this.limitLicenseMapper.selectByCriteria(example);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String id) {
        return this.limitLicenseMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(LimitLicense record) {
        return this.limitLicenseMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int updateByCriteriaSelective(LimitLicense record, LimitLicenseCriteria example) {
        return this.limitLicenseMapper.updateByCriteriaSelective(record, example);
    }

    @Override
    @Transactional
    public int insertSelective(LimitLicense record) {
        return this.limitLicenseMapper.insertSelective(record);
    }
}